package com.mysterymall;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.security.KeyPair;
import java.security.KeyPairGenerator;

@SpringBootApplication
@EnableScheduling
public class MysteryMallApplication {


    public static KeyPair keyPair = generateKeyPair();

    public static void main(String[] args) {
        SpringApplication.run(MysteryMallApplication.class, args);
    }

    private static KeyPair generateKeyPair() {
        try {
            KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
            keyPairGenerator.initialize(2048); // 使用2048位的密钥
            return keyPairGenerator.generateKeyPair();
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

}
